package com.wbt.huawei.c20220717;

import java.util.Scanner;

public class HJ95 {
    public static String[] ten = {"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
    public static String[] power = {"万","亿"};
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()){
            // 分割为整数部分和小数部分
            String[] s = scanner.nextLine().split("\\.");
            if("00".equals(s[1])){
                System.out.println("人民币" + solveInteger(s[0]) +"元整");
            }else if("0".equals(s[0])){
                System.out.println("人民币" + solveDecimal(s[1]));
            }else {
                System.out.println("人民币" + solveInteger(s[0]) + "元" + solveDecimal(s[1]));
            }
        }
    }

    public static String solveDecimal(String s){
        StringBuilder sb = new StringBuilder();
        int jiao = Integer.parseInt(s.substring(0,1));
        int fen = Integer.parseInt(s.substring(1,2));
        if(jiao != 0 ){
            sb.append(ten[jiao]).append("角");
        }
        if(fen != 0){
            sb.append(ten[fen]).append("分");
        }
        return sb.toString();
    }

    public static String solveInteger(String s){
        StringBuilder sb = new StringBuilder();
        Long l = Long.parseLong(s);
        int pow = 0;
        while (l != 0L){
            if(pow!=0){
                sb.append(power[pow-1]);
            }
            int temp = (int) (l % 10000);

            int gewei = temp % 10;
            int shiwei = (temp / 10) % 10;
            int baiwei = (temp/100) % 10;
            int qianwei = (temp/1000) % 10;
            //个位
            if(gewei!=0){
                sb.append(ten[gewei]);
            }
            // 十位
            if(shiwei != 0){
                sb.append("拾");
                if(shiwei != 1){
                    sb.append(ten[shiwei]);
                }
            }else {
                if(gewei != 0 && (temp > 99 || l > 10000L) ){
                    sb.append(ten[0]);
                }
            }
            //百位
            if(baiwei != 0){
                sb.append("佰").append(ten[baiwei]);
            }else {
                if(shiwei != 0 && (temp > 999 || l > 10000L)){
                    sb.append(ten[0]);
                }
            }
            // 千位
            if(qianwei != 0){
                sb.append("仟").append(ten[qianwei]);
            }else {
                if(baiwei != 0 &&  l > 10000L){
                    sb.append(ten[0]);
                }
            }

            l /= 10000L;
            pow++;
            if(pow>2){
                pow=1;
            }
        }
        return sb.reverse().toString();
    }

}
